import 'package:flutter/material.dart';
import 'package:p_location/utils/rich_text_util.dart';

final BoxDecoration _decoration = BoxDecoration(
  color:Colors.white ,
    border: Border(bottom: BorderSide(color: Colors.grey, width: 0.4)));

class NormItem extends StatelessWidget {
  final String leftValue;
  final String rightValue;
  final int rightColor;
  final bool isMust;

  NormItem(this.leftValue, this.rightValue, {this.rightColor = 0xff888888,this.isMust=false});

  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: _decoration,
//      color: Colors.white,
      padding: EdgeInsets.only(left: 20, right: 20, top: 10, bottom: 10),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: <Widget>[
//          Text(leftValue,
//              style: TextStyle(fontSize: 14, color: Color(0xff333333))),
          RichTextUtil.getRichText(leftValue, leftStar: isMust ? '*' : ''),
          Expanded(
            child: Container(
              padding: EdgeInsets.only(left: 15),
              alignment: Alignment.centerRight,
              child: Text(rightValue.toString(),
                  style: TextStyle(fontSize: 14, color: Color(rightColor))),
            ),
          ),
        ],
      ),
    );
  }
}
